package com.codeanalysissys.backend.graphs.pdg;

import com.codeanalysissys.backend.cpp.CppPDGBuilder;
import com.codeanalysissys.backend.golang.GoCDGBuilder;
import com.codeanalysissys.backend.golang.GoPDGBuilder;
import com.codeanalysissys.backend.java.JavaCDGBuilder;
import com.codeanalysissys.backend.java.JavaPDGBuilder;
import com.codeanalysissys.backend.javascript.JavaScriptCDGBuilder;
import com.codeanalysissys.backend.javascript.JavaScriptPDBGuilder;
import com.codeanalysissys.backend.python.PythonCDGBuilder;
import com.codeanalysissys.backend.python.PythonPDGBuilder;
import com.codeanalysissys.backend.ruby.RubyCDGBuilder;
import com.codeanalysissys.backend.ruby.RubyPDGBuilder;

import java.io.IOException;
import java.io.InputStream;

public class CDGBuilder {
    public static ControlDependenceGraph build(String lang, InputStream content) throws IOException {
        switch (lang) {
            case "Cpp":
//                return CppCDGBuilder.build(content);
                return new ControlDependenceGraph();
            //
            case "C":
                return null;
            //
            case "Java":
                return JavaCDGBuilder.build(content);
            case "JavaScript":
                return JavaScriptCDGBuilder.build(content);
            //
            case "Python":
                return PythonCDGBuilder.build(content);
            //
            case "Golang":
                return GoCDGBuilder.build(content);
            case "Ruby":
                return RubyCDGBuilder.build(content);
            //
            default:
                return null;
        }
    }
}
